package com.ruoyi.zhjd.laboratory.modules.disconnectRecord.controller;

import java.util.List;

import cn.dev33.satoken.annotation.SaCheckLogin;

import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;

import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.zhjd.laboratory.modules.disconnectRecord.domain.bo.NSiteDisconnectRecordBo;
import com.ruoyi.zhjd.laboratory.modules.disconnectRecord.domain.vo.NSiteDisconnectRecordVo;
import com.ruoyi.zhjd.laboratory.modules.disconnectRecord.service.INSiteDisconnectRecordService;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 工地现场断网记录
 *
 * @author zyb
 * @date 2023-10-13
 */
@Validated
@RestController
@RequestMapping("/zhgd/siteDisconnectRecord")
public class NSiteDisconnectRecordController extends BaseController {
	@Autowired
    private INSiteDisconnectRecordService iNSiteDisconnectRecordService;
	/**
     * 查询实验室断网记录列表
     */
    //@SaCheckPermission("xtcsgl:siteDisconnectRecord:list")
    @GetMapping("/list")
    @SaCheckLogin
    public TableDataInfo<NSiteDisconnectRecordVo> list(NSiteDisconnectRecordBo bo, PageQuery pageQuery) {
        return iNSiteDisconnectRecordService.queryPageList(bo, pageQuery);
    }
    /**
     * 查询拌合站断网记录列表
     */
    //@SaCheckPermission("xtcsgl:siteDisconnectRecord:list")
    @GetMapping("/bhzList")
    @SaCheckLogin
    public TableDataInfo<NSiteDisconnectRecordVo> bhzList(NSiteDisconnectRecordBo bo, PageQuery pageQuery) {
        return iNSiteDisconnectRecordService.queryBhzPageList(bo, pageQuery);
    }
    /**
     * 获取工地现场断网记录详细信息
     *
     *
     */
    @SaCheckLogin
    @GetMapping("/equipmentOffline")
    public TableDataInfo<NSiteDisconnectRecordVo> equipmentOffline(@NotNull(message = "主键不能为空")
    				NSiteDisconnectRecordBo bo, PageQuery pageQuery) {
        return iNSiteDisconnectRecordService.equipmentOffline(bo,pageQuery);
    }

    /**
     * 获取工地现场断网记录详细信息
     *
     *
     */
    @SaCheckLogin
    @GetMapping("/equipmentOfflineDetail")
    public TableDataInfo<NSiteDisconnectRecordVo> equipmentOfflineDetail(@NotNull(message = "主键不能为空")
    				NSiteDisconnectRecordBo bo, PageQuery pageQuery) {
        return iNSiteDisconnectRecordService.equipmentOfflineDetail(bo,pageQuery);
    }

    /**
     * 导出工地现场断网记录列表
     */
    @SaCheckLogin
    @Log(title = "工地现场断网记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(NSiteDisconnectRecordBo bo, HttpServletResponse response) {
        List<NSiteDisconnectRecordVo> list = iNSiteDisconnectRecordService.queryList(bo);
        ExcelUtil.exportExcel(list, "工地现场断网记录", NSiteDisconnectRecordVo.class, response);
    }

    /**
     * 查询实验室实时断网记录列表（废弃）
     */
    @SaCheckLogin
    @GetMapping("/getSiteOnlineRecord")
    public TableDataInfo<NSiteDisconnectRecordVo> getSiteOnlineRecord(NSiteDisconnectRecordBo bo, PageQuery pageQuery) {
        return iNSiteDisconnectRecordService.getSiteOnlineRecord(bo, pageQuery);
    }
}
